<?php

/**
 * This file is part of the Framework03 PHP framework.
 * @author Walter Tamboer
 * @package Framework03
 */

abstract class FW_Controller_Dispatcher_Abstract
{
    /**
     * @var FW_Controller_Request_Abstract The request used to request the controller.
     */
    protected $request;

    /**
     * @var FW_Controller_Response_Abstract The response used to respond to the controller.
     */
    protected $response;


    /**
     * Sets the request used to request the controller.
     * @param FW_Controller_Request_Abstract $request
     * @return FW_Controller_Dispatcher_Abstract
     */
    public function setRequest(FW_Controller_Request_Abstract $request)
    {
        $this->request = $request;
        return $this;
    }
    
    /**
     * Gets the request that was used to request the controller.
     * @return FW_Controller_Request_Abstract
     */
    public function getRequest()
    {
        return $this->request;
    }
    
    /**
     * Gets the response that is used to respond to the controller.
     * @return FW_Controller_Response_Abstract
     */
    public function getResponse()
    {
        return $this->response;
    }

    /**
     * Sets the response used to respond to the controller.
     * @param FW_Controller_Response_Abstract $response
     * @return FW_Controller_Dispatcher_Abstract
     */
    public function setResponse(FW_Controller_Response_Abstract $response)
    {
        $this->response = $response;
        return $this;
    }

    abstract public function dispatch(FW_Controller_Request_Abstract $request, FW_Controller_Response_Abstract $response);
}
